<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="wrapper">
        <div class="inner">
            <p>文字是人类用符号记录表达信息以传之久远的方式和工具。现代文字大多是记录语言的工具。</p>
        </div>
    </div>
    <button id="open" style="margin-left: 50%;">open</button>
    <style>
        .inner {
            background-color: cadetblue;
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: 280px;
            transition: all .6s ease-out;
            z-index: 10000;
            transform: translateX(-100%);
        }

        .inner.open{
            transform: translateX(0%);
        }
    </style>
    <script>
        const inner = document.querySelector('.inner');
        const btn = document.querySelector('#open');
        btn.addEventListener('click', function(e) {
            inner.classList.toggle('open');
        });
    </script>
</body>
</html>